home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 9459 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1020 b 

  1. Path: keats.ugrad.cs.ubc.ca!not-for-mail
  2. From: c2a192@ugrad.cs.ubc.ca (Kazimir Kylheku)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: __argv[0] bug under Win 95?
  5. Date: 10 Mar 1996 11:55:32 -0800
  6. Organization: Computer Science, University of B.C., Vancouver, B.C., Canada
  7. Message-ID: <4hvc3kINNeq@keats.ugrad.cs.ubc.ca>
  8. References: <4hr196$1hl@murphy2.servtech.com>
  9. NNTP-Posting-Host: keats.ugrad.cs.ubc.ca
  10.  
  11. In article <4hr196$1hl@murphy2.servtech.com>,
  12. Terry Carmen  <tpcarmen@servtech.com> wrote:
  13.  >For some reason __argv[0] is empty under Windows 95, but contains the program name 
  14.  
  15. __argv is not part of the C standard. 
  16.  
  17.  
  18.  >and path as it should under Win 3.1x and Win NT.
  19.  >
  20.  >Does anybody have any idea why, or how I can obtain the name of the currently 
  21.  >executing (16 bit) app under Win 95?
  22.  
  23. A C program can determine its name by looking at the string argv[0], assuming
  24. that you have defined your main as ``int main(int argc, char *argv[])''.
  25. On systems where the program name is not available, argv[0][0] is zero.
  26. -- 
  27.  
  28.